package cn.action;


import javax.annotation.Resource;

import cn.model.User;
import cn.service.UserService;

import com.opensymphony.xwork2.ActionSupport;


public class UsreAction extends ActionSupport {

	private static final long serialVersionUID = -8559587316926354939L;

	private User user;
	private UserService userServiceImpl;
	
	
	
	public User getUser() {
		return user;
	}



	public void setUser(User user) {
		this.user = user;
	}



	public UserService getUserServiceImpl() {
		return userServiceImpl;
	}

	@Resource(name="userServiceImpl")
	public void setUserServiceImpl(UserService userServiceImpl) {
		this.userServiceImpl = userServiceImpl;
	}



	public String add(){
		if(userServiceImpl.addUser(user)==1)
			return "addSuccess";
		else
			return "addError";
	}
	
}
